package cn.com.pagoda.ideplugin.common.transcoder;

import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;

/**
 * @Author xieluxin
 * @Date 2023/7/9 11:18
 * @Version 1.0
 */
@FunctionalInterface
public interface ReverseTranscodeFunction  {

    /**
     * 反向转换(解码/解密)函数
     *
     * @param text 原内容
     * @param key 秘钥key, 不需要可以传null
     * @return 返回以字符串表示的值
     */
    String reverseTranscode(String text,String key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, InvalidKeySpecException, InvalidAlgorithmParameterException;
}